<!DOCTYPE html>
<html>
    <head>
        <title> 工程实施</title>
        <meta http-equiv='content-type' content='text/html; charset=UTF-8'/>
        <script type="text/javascript" src="../../js/head.js"></script>
        <script type="text/javascript" src="../../js/ope/imp.head.js"></script>
        <script type="text/javascript">
            // 当前操作的是方案、线路、终端？
            var currObj = null;
            // 工作模式
            var workMode = -1;
            // 初始化前一点的坐标
            var preCoord = new Point(0, 0);
            // SVG元素的根
            var WORK_SVG = null;
            // 拖拽前的坐标
            var dragPreCoord = new Point(0, 0);
            // 定时器
            var TIME_OUT;
            // 是否已启动定时器
            var IS_START_TIME_OUT;

            // 文档加载完后初始化（创建实施方案树、调整布局使之满屏、绑定部分事件）
            $(document).on("pageinit", function(event) {

                // 启用蓝牙
                try {
                    window.configjsi.enableBlueTooth();
                } catch(e) {
                }

                // 动态获取实施方案树
                try {
                    window.schemejsi.querySchemeTreeNodes();
                } catch (e) {
                }

                $("#commautotestbtn").button("disable");
                // 禁用导航按钮
                $("#modebar ul li input").button("disable");

                // 调整布局
                adjustLayout();

                // 判断是否加载串口，如果需要与串口通信的模块都需要加此段
                try {
                    window.debugjsi.isUSBAttached();
                } catch(e) {
                }

                // 导航工具栏项目点击事件 ，切换不同的工作模式
                $("#modebar ul li input").unbind("tap").bind("tap", function(event) {

                    $("#modebar ul li div").removeClass("ui-btn-active");

                    $(this).parent().addClass("ui-btn-active");

                    $("#commautotestbtn").button("disable");

                    // 取消选中状态
                    clearSelectedStatus();

                    // 取消通信自测
                    clearCommAutoTestTimeout();

                    // 切换工作模式
                    var id = $(this).attr("id");
                    workMode = id.split("_")[1];

                    // 通过空白窗口的开启和关闭来隐藏已弹出的窗口
                    $("#triggerblankpopup").click();
                    $("#blankpopup").popup("close");

                    if (2 == workMode) {
                        $("#searchaddr", $("#searchpopup")).val("");
                        $("#triggersearchpopup").click();
                        // 调整top位置
                        var top = $("#searchpopup-popup").css("top").replace("px", "");
                        $("#searchpopup-popup").css("top", (Number(top) - 40) + "px");
                        $("#searchbtn").unbind("tap").bind("tap", searchIndicators);
                    } else {
                        $("#searchpopup").popup("close");
                        if (1 == workMode) {
                            // 启用通信自测按钮
                            $("#commautotestbtn").button("enable");
                        }
                    }

                    // 在工作模式切换下保存SVG图
                    try {
                        var terminalId = $("#terminalid").val();
                        var svgContent = $("#implementcontent").html();
                        window.terminaljsi.saveSVGContent(terminalId, svgContent, 2);
                    } catch (e) {
                    }
                });

                // 指示器弹出窗口，关闭之后的回调方法
                $("#igrouppopup").on("popupafterclose", function(event, ui) {
                    cancelEditIGroupAfterClose();
                });

                // 增删改按钮绑定事件
                $("#schemeaddbtn").unbind("tap").bind("tap", add);
                $("#addbtn", $("#popupmenu")).unbind("tap").bind("tap", add);
                $("#modifybtn", $("#popupmenu")).unbind("tap").bind("tap", modify);
                $("#removebtn", $("#popupmenu")).unbind("tap").bind("tap", remove);
                $("#modifybtn", $("#igrouppopupmenu")).unbind("tap").bind("tap", modify);
                $("#removebtn", $("#igrouppopupmenu")).unbind("tap").bind("tap", remove);
                // 实时电流
                $("#rtcurrentbtn", $("#igrouppopupmenu")).unbind("tap").bind("tap", showRTCurrentWin);
                // 休眠时间
                $("#sleeptimebtn", $("#igrouppopupmenu")).unbind("tap").bind("tap", showSleepTimeWin);
                // 通信目的指示器
                $("#targetindicatorbtn", $("#igrouppopupmenu")).unbind("tap").bind("tap", showCommTargetIndicatorWin);
                // 指示器版本信息
                $("#indicatorverbtn", $("#igrouppopupmenu")).unbind("tap").bind("tap", showIndicatorVerWin);
                // 指示翻牌复归
                $("#fliptestbtn", $("#igrouppopupmenu")).unbind("tap").bind("tap", showIndicatorFlipWin);
                // 指示器实时电场
                $("#rtefbtn", $("#igrouppopupmenu")).unbind("tap").bind("tap", showIndicatorElecFieldWin);
                // 重设指示器模块地址
                $("#commaddrresetbtn", $("#igrouppopupmenu")).unbind("tap").bind("tap", showIndicatorCommAddrResetWin);

                /**
                 * 终端弹出菜单
                 */
                $("#modifybtn", $("#terminalpopupmenu")).unbind("tap").bind("tap", modify);
                // 查询终端版本信息
                $("#terminalverbtn", $("#terminalpopupmenu")).unbind("tap").bind("tap", getTerminalVersion);
                // 查设终端地址
                $("#qsterminaladdrbtn", $("#terminalpopupmenu")).unbind("tap").bind("tap", showTerminalAddrQRWin);
                // 查设通信参数
                $("#qscommparamsbtn", $("#terminalpopupmenu")).unbind("tap").bind("tap", showTerminalCommParamsQSWin);
                // 查设通信状态
                $("#qscommstatusbtn", $("#terminalpopupmenu")).unbind("tap").bind("tap", getTerminalCommStatus);
                // 终端复位
                $("#terminalresetbtn", $("#terminalpopupmenu")).unbind("tap").bind("tap", resetTerminal);

                // 展开/关闭 实施信息 的panel后，隐藏/显示 svg中的按钮区域
                $("#showimplinfo").on("panelbeforeopen", function() {

                    // 判断是否打开了SVG图形
                    var terminalId = $("#terminalid").val();
                    if (terminalId.trim().length > 0) {
                        $("#svgoperdiv").hide();
                    }
                });

                $("#showimplinfo").on("panelbeforeclose", function() {
                    // 判断是否打开了SVG图形
                    var terminalId = $("#terminalid").val();
                    if (terminalId.trim().length > 0) {
                        $("#svgoperdiv").show();
                    }
                });

                // 点击工程日志的日志tab
                $("#impllogtab").unbind("tap").bind("tap", function() {
                    $("#implstatustabcontent").hide();
                    $("#impllogtabcontent").show();
                });

                // 点击实施的状态tab
                $("#implstatustab").unbind("tap").bind("tap", function() {
                    $("#implstatustabcontent").show();
                    $("#impllogtabcontent").hide();

                    // 显示指示器状态
                    var terminalId = $("#terminalid").val();
                    if (terminalId.trim().length > 0) {
                        queryIndicatorStatuses(terminalId);
                    }
                });

                // 清除日志
                $("#clearlogbtn").unbind("tap").bind("tap", function() {
                    $(".log-div", $("#impllogtabcontent")).empty();
                    COUNT_LOG = 1;
                    CURR_PAGE = 1;
                });
            });

            /**
             * 动态加载实施方案树的回调方法，显示实施方案树，并对树上的节点动态绑定方法（长按和点击事件）
             */
            var loadSTreeCallback = function(data) {
                var schemeTree = "";
                for (var i = 0; i < data.length; i++) {
                    var schemeObj = data[i];
                    var workLines = schemeObj.workLines;

                    var collapsed = "";
                    if (0 == i) {
                        collapsed = ' data-collapsed="false"';
                    }

                    schemeTree += '<div data-role="collapsible" data-theme="f" data-content-theme="f" ' + collapsed + ' >' + '<h3 class="custom-scheme" id="scheme_' + schemeObj._id + '">' + schemeObj.schemename + '</h3>';
                    if (workLines.length > 0) {
                        schemeTree += '<ul class="terminal-list" data-role="listview" data-inset="true" data-divider-theme="c">';
                    }

                    for (var j = 0; j < workLines.length; j++) {

                        var workLineObj = workLines[j];
                        var terminals = workLineObj.terminals;
                        var lineName = workLineObj.linename;
                        if (lineName.strLen() > WORKLINE_NAME_LENGTH_SHOW - 3) {
                            lineName = lineName.substring(0, WORKLINE_NAME_LENGTH_SHOW - 3) + "...";
                        }

                        schemeTree += '<li id="workline_' + workLineObj._id + '" data-role="list-divider" class="custom-workline">' + lineName + '</li>';

                        for (var k = 0; k < terminals.length; k++) {
                            var terminalObj = terminals[k];
                            schemeTree += '<li id="terminal_' + terminalObj._id + '" class="custom-terminal">' + terminalObj.terminaladdr + '</li>';
                        }
                    }
                    if (workLines.length > 0) {
                        schemeTree += '</ul>';
                    }

                    schemeTree += '</div>';
                }

                // 拼接、创建实施方案树，并刷新
                $("#schemetree").html(schemeTree);
                $("#schemetree").trigger('create').collapsibleset("refresh");

                // 长按方案名，弹出操作对话框
                $(".custom-scheme").unbind("taphold").bind("taphold", function(event) {
                    $("a", $("#popupmenu")).show();
                    var id = $(this).attr("id").split("_")[1];
                    if (1 == id) {// 默认方案不能编辑
                        $($("a", $("#popupmenu"))[1]).css({
                            "display" : "none"
                        });
                        $($("a", $("#popupmenu"))[2]).css({
                            "display" : "none"
                        });
                    }
                    showPopup(this);
                    return false;
                });

                // 长按线路名，弹出操作对话框
                $(".custom-workline").unbind("taphold").bind("taphold", function(event) {
                    $("a", $("#popupmenu")).show();
                    showPopup(this);
                    return false;
                });

                // 长按终端，弹出操作对话框，其中屏蔽新增按钮
                $(".custom-terminal").unbind("taphold").bind("taphold", function(event) {
                    $("a", $("#popupmenu")).show();
                    // 隐藏新增按钮
                    $($("a", $("#popupmenu"))[0]).css({
                        "display" : "none"
                    });

                    showPopup(this);
                    return false;
                });

                // 点击实施方案树上的终端
                $(".custom-terminal").unbind("click").bind("click", function(event) {

                    if ($(this).attr("id").split("_")[1] != $("#terminalid").val()) {
                        $("#modebar ul li div").removeClass("ui-btn-active");
                        // 启用导航按钮
                        $("#modebar ul li input").button("enable");
                        // 点击终端后，默认进入安装模式
                        $("#mode_0").click();
                        workMode = 0;
                        $("#mode_0").parent().addClass("ui-btn-active");

                        $("a", $("#igrouppopupmenu")).show();
                        // 隐藏指示器组中的实时电流按钮、休眠时间按钮、通信目的指示器按钮
                        $("#rtcurrentbtn", $("#igrouppopupmenu")).css({
                            "display" : "none"
                        });
                        $("#sleeptimebtn", $("#igrouppopupmenu")).css({
                            "display" : "none"
                        });
                        $("#targetindicatorbtn", $("#igrouppopupmenu")).css({
                            "display" : "none"
                        });
                    }

                    // 在终端树上点击时保存（即使未切换终端），保存当前打开的SVG图
                    try {
                        var terminalId = $("#terminalid").val();
                        if (terminalId && 0 != terminalId.trim().length) {
                            var svgContent = $("#implementcontent").html();
                            window.terminaljsi.saveSVGContent(terminalId, svgContent, 3);
                        }
                    } catch(e) {
                    }

                    // 向后台请求svg文件
                    try {
                        var _id = $(this).attr("id").split("_")[1];
                        // 终端ID
                        var params = "{'_id': '" + _id + "'}";
                        window.terminaljsi.getSVGContent(params);
                    } catch(e) {
                    }
                });

                // 打开实施方案panel
                $("#showscheme").panel("open");
                return false;
            };

            /**
             * 实施方案树上，点击终端后的回调方法，加载SVG、绑定事件
             */
            var tapTerminalCallback = function(data) {

                // 关掉弹出的panel
                $("#showscheme").panel("close");

                // 加载SVG
                $("#implementcontent").html(data.svgcontent);
                $("#svgoperdiv").show();
                $("#savesvgbtn", $("#svgoperdiv")).unbind("tap").bind("tap", function() {
                    // 在工作模式切换下保存SVG图
                    try {
                        var terminalId = $("#terminalid").val();
                        var svgContent = $("#implementcontent").html();
                        window.terminaljsi.saveSVGContent(terminalId, svgContent, 1);
                    } catch (e) {
                    }
                });

                // 通信自测
                $("#commautotestbtn", $("#svgoperdiv")).unbind("touchend").bind("touchend", function() {

                    COUNT_COMM_FAIL = 0;

                    if (null == DEFAULT_IGROUP_ID || undefined == DEFAULT_IGROUP_ID || 0 == DEFAULT_IGROUP_ID.trim().length) {
                        if (null == COMM_TARGET_INDICATOR_ADDR || undefined == COMM_TARGET_INDICATOR_ADDR || 0 == COMM_TARGET_INDICATOR_ADDR.trim().length) {
                            showMsg("通信检测的上一级指示器组不存在, 请先安装!");
                            return;
                        }
                    }

                    if (IS_START_TIME_OUT) {
                        clearCommAutoTestTimeout();
                    } else {
                        IS_START_TIME_OUT = true;

                        $(this).val("取消");
                        $(this).button({
                            theme : 'e'
                        }).button("refresh");

                        var msg = "通信自测已启动!";
                        showMsg(msg, 2000);
                        addLog(msg);

                        COMM_STATUS = true;
                        testComm();
                    }
                });

                // WORK_SVG，SVG根
                WORK_SVG = document.getElementById('worksvg');

                // 将终端信息放入隐藏控件
                $("#tlineid").val(data.lineid);
                $("#currterminal").val(data.terminaladdr);
                $("#terminalid").val(data._id);
                $("#twirelessaddr").val(data.wirelessaddr);
                $("#tlocation").val(data.location);

                // 调整svg的高度
                $(WORK_SVG).css({
                    "height" : FULL_SCREEM_HEIGHT - HEADER_HEIGHT - FOOTER_HEIGHT
                });

                // 创建终端，绑定方法
                createTerminal(data.terminaladdr);

                // 显示指示器状态
                queryIndicatorStatuses(data._id);

                // 更新指示器组的分支级数（如果通过数据管理修改了的情况）
                modifyIGroupBranchLevel(data._id);

                // 在SVG上点击事件，安装模式下安装指示器
                $(WORK_SVG).unbind("click").bind("click", function(event) {
                    if (0 == workMode) {// 安装模式下
                        installIndicator(event);
                    }
                });

                // 在SVG上滑动，建立指示器组和指示器组、指示器组和终端之间的连线
                $(WORK_SVG).unbind("vmousemove").bind("vmousemove", function(event) {
                    if (1 != workMode) {
                        return;
                    }

                    var x = event.pageX;
                    var y = event.pageY - HEADER_HEIGHT;
                    var point = new Point(x, y);

                    var space = Math.pow(Math.pow((x - preCoord.x), 2) + Math.pow((y - preCoord.y), 2), 0.5);

                    if (space > (0.5 * RADIUS)) {// 步长
                        preCoord = point;
                        selectIgroupElem(point, event);
                    }
                });

                // 滑动停止，下发多级召测
                $(WORK_SVG).unbind("vmouseup").bind("vmouseup", function(event) {
                    if (1 != workMode) {
                        return;
                    }

                    relayCommTest();
                });

                /**
                 * 横向滑动较大的距离（30个像素），取消选中状态
                 */
                $(WORK_SVG).unbind("swipe").bind("swipe", function(event) {
                    clearSelectedStatus();
                });

                /**
                 * 指示器组长按live绑定（当前和未来的指示器组都具有的事件）
                 */
                $("g[etype='indicator']").unbind("taphold").bind("taphold", function(event) {

                    if (2 == workMode) {
                        return;
                    } else if (0 == workMode) {
                        $("a", $("#igrouppopupmenu")).show();
                        // 隐藏指示器组中的实时电流按钮、休眠时间按钮、通信目的指示器按钮
                        $("#rtcurrentbtn", $("#igrouppopupmenu")).css({
                            "display" : "none"
                        });
                        $("#sleeptimebtn", $("#igrouppopupmenu")).css({
                            "display" : "none"
                        });
                        $("#targetindicatorbtn", $("#igrouppopupmenu")).css({
                            "display" : "none"
                        });
                        $("#indicatorverbtn", $("#igrouppopupmenu")).css({
                            "display" : "none"
                        });
                        $("#fliptestbtn", $("#igrouppopupmenu")).css({
                            "display" : "none"
                        });
                        $("#rtefbtn", $("#igrouppopupmenu")).css({
                            "display" : "none"
                        });
                        $("#commaddrresetbtn", $("#igrouppopupmenu")).css({
                            "display" : "none"
                        });
                    } else if (1 == workMode) {
                        $("a", $("#igrouppopupmenu")).show();
                        // 隐藏指示器组中的修改按钮、删除按钮
                        $("#modifybtn", $("#igrouppopupmenu")).css({
                            "display" : "none"
                        });
                        $("#removebtn", $("#igrouppopupmenu")).css({
                            "display" : "none"
                        });
                    }
                    workElem = this;
                    clearSelectedStatus();

                    /**$("a", $("#popupmenu")).show();
                     // 隐藏新增按钮，弹出修改和删除按钮
                     $($("a", $("#popupmenu"))[0]).css({
                     "display" : "none"
                     });**/
                    showIGroupOperPopup(this);

                    changeSelectedStatus(this, 1);
                    return false;
                });

                // 对当前指示器组绑定点击事件：安装模式下加载指示器组信息；查询模式下消息框的形式显示指示器组信息
                $("g[etype='indicator']").unbind("click").bind("click", function(event) {

                    var group = this;
                    currObj = this;
                    workElem = this;

                    if (2 == workMode) {
                        var id = group.id;
                        var tip = "选中设备: 指示器组 [ " + id + "组 ]<br/>";

                        var children = group.childNodes;

                        var iid = children[1].id;
                        if (iid) {
                            tip += "A相地址: " + iid.substring(9) + "<br/>";
                        }

                        iid = children[2].id;
                        if (iid) {
                            tip += "B相地址: " + iid.substring(9) + "<br/>";
                        }

                        iid = children[3].id;
                        if (iid) {
                            tip += "C相地址: " + iid.substring(9) + "<br/>";
                        }

                        showMsg(tip, 6000);
                    }

                    return false;
                });

                /**
                 * 对打开的SVG的指示器组绑定拖拽事件，重绘之间的连线
                 */
                $("g[etype='indicator']").pep({
                    SVGtype : true,
                    constrainTo : 'window',
                    drag : function(ev, obj) {
                        if (0 != workMode) {
                            return false;
                        }

                        var x = ev.pep.x;
                        var y = ev.pep.y - HEADER_HEIGHT;

                        var point = new Point(x, y);
                        var space = Math.pow(Math.pow((x - dragPreCoord.x), 2) + Math.pow((y - dragPreCoord.y), 2), 0.5);

                        if (space > (0.5 * RADIUS)) {// 步长
                            dragPreCoord = point;
                            repaintLine(obj);
                        }
                    },
                    stop : function(ev, obj) {
                        if (0 != workMode) {
                            return false;
                        }

                        repaintLine(obj);
                    }
                });

                // 给当前和未来的连线绑定长按事件，长按则删除
                $("g[etype='line']").live("taphold", function(event) {

                    WORK_SVG.removeChild(this);

                    var str = "删除连线 [ " + this.childNodes[1].textContent + " ]!";
                    showMsg(str);

                    clearSelectedStatus();

                    return false;
                });
            };

            //初始化绑定iScroll控件
            document.addEventListener('DOMContentLoaded', loaded, false);
        </script>
        <style>
            .jGrowl .jGrowl-closer, .jGrowl .jGrowl-notification {
                text-shadow: 0 -1px 0 #000;
            }
            .info-td {
                padding-left: 10px;
                padding-right: 10px;
                color: red;
            }
        </style>
    </head>
    <body>
        <div data-role="page" id="implementpage" data-dom-cache="true">

            <!-- 空白操作对话框 -->
            <a href="#blankpopup" id="triggerblankpopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="blankpopup" data-dismissible="false" data-overlay-theme="f"></div>

            <!-- 信息对话框 -->
            <a href="#infopopup" id="triggerinfopopup" data-rel="popup" data-role="button" data-position-to="#Terminal" style="display: none;"></a>
            <div data-role="popup" id="infopopup" class="ui-content" data-dismissible="true" data-theme="c" style="min-width: 350px">
                <a href="#" data-rel="back" data-role="button" data-theme="c" data-icon="delete" data-iconpos="notext" class="ui-btn-left">Close</a>
                <div id="opermsg"></div>
            </div>

            <!-- 通信测试和组网选择对话框 -->
            <a href="#debugconfirmpopup" id="triggerdebugconfirmpopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="debugconfirmpopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <!--
                    <h1>操作选择</h1>
                    -->
                    <h1>组网</h1>
                </div>
                <div data-role="content">
                    <!--
                    <h4>请选择操作 [ 通信测试 ] 或 [ 组网 ]</h4>
                    <p>
                    注意, 多级调试的第一个节点是终端会弹出此对话框!
                    </p>
                    -->
                    <h4>是否进行组网操作 ?</h4>
                    <div class="btn-float-left">
                        <!--
                        <a href="#" data-role="button" id="tcommtestbtn" data-inline="true" data-theme="e">通信测试</a>
                        -->
                        <a href="#" data-role="button" id="tnetworkbtn" data-inline="true" data-theme="e">组网</a>
                        <a href="#" data-role="button" id="tcanclebtn" data-inline="true" data-theme="f">取消</a>
                    </div>
                </div>
            </div>

            <!-- SVG 操作按钮区域 -->
            <div id="svgoperdiv" style="position: fixed; z-index: 1; top: 46px; right: 10px; display: none;">
                <a id="savesvgbtn" data-role="button" data-inline="true" data-theme="e">保存图形</a>
                <button id="commautotestbtn" data-role="button" data-inline="true" data-theme="f" value="通信自测"></button>
            </div>

            <!-- 搜索对话框 -->
            <a href="#searchpopup" id="triggersearchpopup" data-rel="popup" data-role="button" data-position-to="#mode_2" data-transition="slideup" style="display: none;"></a>
            <div data-role="popup" id="searchpopup" class="ui-content" data-dismissible="true" style="max-width: 280px;" data-theme="c">
                <a href="#" data-rel="back" data-role="button" data-theme="c" data-icon="delete" data-iconpos="notext" class="ui-btn-left">Close</a>
                <table>
                    <tr>
                        <td>
                        <input type="search" name="searchaddr" id="searchaddr" value="" placeholder="指示器地址" onfocus="window.configjsi.disableBlueTooth();"/>
                        </td><td><a id="searchbtn" data-role="button" data-inline="true" data-theme="f">查询</a></td>
                    </tr>
                </table>
            </div>

            <!-- 指示器组编辑对话框 -->
            <a href="#igrouppopup" id="triggerigrouppopup" data-rel="popup" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="igrouppopup" data-position-to="window" data-dismissible="false"
            data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>指示器组<span id="igroupoperspan"></span></h1>
                </div>
                <div data-role="content">
                    <input type="hidden" id="opermode" name="opermode"/>
                    <input type="hidden" id="groupno" name="groupno"/>
                    <input type="hidden" id="indicatorid_a" name="indicatorid_a"/>
                    <input type="hidden" id="indicatorid_b" name="indicatorid_b"/>
                    <input type="hidden" id="indicatorid_c" name="indicatorid_c"/>
                    <table width="100%">
                        <tr>
                            <td colspan="2" width="80%">
                            <fieldset style="border: 1px dashed #08a09e; padding: 5px;">
                                <legend>
                                    <label for="indicatoraddr_a">指示器地址<font style="color: red;"> * </font></label>
                                </legend>
                                <table width="100%">
                                    <tr>
                                        <td align="center"><label for="indicatoraddr_a">A相</label></td><td align="center"><label for="indicatoraddr_b">B相</label></td><td align="center"><label for="indicatoraddr_c">C相</label></td>
                                    </tr>
                                    <tr>
                                        <td>
                                        <input type="text" id="indicatoraddr_a" value="" placeholder="A相地址" onfocus="window.configjsi.enableBlueTooth();this.focused=true;this.select();" onmouseup="if(this.focused){this.focused=false;return false;}"/>
                                        </td><td>
                                        <input type="text" id="indicatoraddr_b" value="" placeholder="B相地址" onfocus="window.configjsi.enableBlueTooth();this.focused=true;this.select();" onmouseup="if(this.focused){this.focused=false;return false;}"/>
                                        </td>
                                        <td>
                                        <input type="text" id="indicatoraddr_c" value="" placeholder="C相地址" onfocus="window.configjsi.enableBlueTooth();this.focused=true;this.select();" onmouseup="if(this.focused){this.focused=false;return false;}"/>
                                        </td>
                                    </tr>
                                </table>
                            </fieldset></td>
                            <td rowspan="3" width="20%" valign="top">
                            <div style="margin-left: 10px;">
                                <a href="#" data-role="button" data-inline="true" data-theme="f" id="igroupeditbtn"></a>
                                <a href="#" data-role="button" data-inline="true" data-theme="e" id="igroupcancelbtn">取消</a>
                            </div></td>
                        </tr>
                        <tr>
                            <td><label for="location">安装位置</label></td>
                            <td>
                            <input type="text" id="location" placeholder="安装位置" onfocus="window.configjsi.disableBlueTooth();"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2"><span class="tipcontentspan"></span></td>
                            <td>&nbsp;</td>
                        </tr>
                    </table>
                </div>

            </div>

            <!-- 操作对话框 -->
            <div data-role="popup" id="popupmenu">
                <div data-role="controlgroup" id="menugroup" data-type="horizontal" data-transition="pop" data-theme="f">
                    <a href="#" data-role="button" data-icon="plus" id="addbtn" data-theme="f">添加</a>
                    <a href="#" data-role="button" data-icon="edit" id="modifybtn" data-theme="f">修改</a>
                    <a href="#" data-role="button" data-icon="minus" id="removebtn" data-theme="f">删除</a>
                </div>
            </div>

            <!-- 指示器操作对话框 -->
            <div data-role="popup" id="igrouppopupmenu">
                <div data-role="controlgroup" id="igmenugroup" data-type="vertical" data-transition="pop" data-theme="f">
                    <a href="#" data-role="button" data-icon="edit" id="modifybtn" data-theme="f">修改</a>
                    <a href="#" data-role="button" data-icon="minus" id="removebtn" data-theme="f">删除</a>
                    <a href="#" data-role="button" data-icon="info" id="rtcurrentbtn" data-theme="f">实时电流</a>
                    <a href="#" data-role="button" data-icon="gear" id="sleeptimebtn" data-theme="f">休眠时间</a>
                    <a href="#" data-role="button" data-icon="gear" id="targetindicatorbtn" data-theme="f">通信目的指示器</a>
                    <a href="#" data-role="button" data-icon="info" id="indicatorverbtn" data-theme="f">版本信息</a>
                    <a href="#" data-role="button" data-icon="gear" id="fliptestbtn" data-theme="f">翻牌复归</a>
                    <a href="#" data-role="button" data-icon="info" id="rtefbtn" data-theme="f">实时电场</a>
                    <a href="#" data-role="button" data-icon="gear" id="commaddrresetbtn" data-theme="f">重设模块地址</a>
                </div>
            </div>

            <!-- 终端操作对话框 -->
            <div data-role="popup" id="terminalpopupmenu">
                <div data-role="controlgroup" id="terminalmenugroup" data-type="vertical" data-transition="pop" data-theme="f">
                    <a href="#" data-role="button" data-icon="edit" id="modifybtn" data-theme="f">修改</a>
                    <a href="#" data-role="button" data-icon="info" id="terminalverbtn" data-theme="f">版本信息</a>
                    <a href="#" data-role="button" data-icon="gear" id="qsterminaladdrbtn" data-theme="f">终端地址</a>
                    <a href="#" data-role="button" data-icon="gear" id="qscommparamsbtn" data-theme="f">通信参数</a>
                    <a href="#" data-role="button" data-icon="info" id="qscommstatusbtn" data-theme="f">通信状态</a>
                    <a href="#" data-role="button" data-icon="gear" id="terminalresetbtn" data-theme="f">复位</a>
                </div>
            </div>

            <!-- 实时电流操作对话框 -->
            <a href="#rtcurrentpopup" id="triggerrtcurrentpopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="rtcurrentpopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>实时电流</h1>
                </div>
                <div data-role="content">
                    <table>
                        <tr>
                            <td width="110px"><label for="aphase">相位<font style="color: red;"> * </font></label></td>
                            <td><label>
                                <input type="radio" name="phase" id="aphase" onclick="selectPhase('1','1')">
                                A相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="bphase" onclick="selectPhase('2','1')">
                                B相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="cphase" onclick="selectPhase('3','1')">
                                C相</label></td>
                        </tr>
                        <tr id="rtcurrentinfo" style="display: none;">
                            <td>指示器地址</td><td id="rtindicatoraddr" style="color: gray;"></td>
                            <td id="rtcurrentlabel">实时电流</td>
                            <td id="rtcurrent" style="color:red;"></td>
                        </tr>
                        <tr>
                            <td colspan="4"><span class="tipcontentspan"></span></td>
                        </tr>
                        <tr>
                            <td colspan="4">
                            <div class="btn-float-left">
                                <input type="button" id="rtcurrentbtn" data-inline="true" data-theme="f" value="读取" style="width: 105px;"/>
                                <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="e">取消</a>
                            </div></td>
                        </tr>
                    </table>
                </div>
            </div>

            <!-- 休眠时间操作对话框 -->
            <a href="#sleeptimepopup" id="triggersleeptimepopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="sleeptimepopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>休眠时间</h1>
                </div>
                <div data-role="content">
                    <table>
                        <tr>
                            <td width="110px"><label for="aphase">相位<font style="color: red;"> * </font></label></td>
                            <td><label>
                                <input type="radio" name="phase" id="aphase" onclick="selectPhase('1','2')">
                                A相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="bphase" onclick="selectPhase('2','2')">
                                B相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="cphase" onclick="selectPhase('3','2')">
                                C相</label></td>
                        </tr>
                        <tr id="stindicatorinfo" style="display: none;">
                            <td>指示器地址</td><td id="stindicatoraddr" style="color: gray;"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td><label for="sleeptime">休眠时间</label></td>
                            <td colspan="3">
                            <select name="sleeptime" id="sleeptime">
                                <option value="1" selected="selected">1 秒</option>
                                <option value="20">20 秒</option>
                            </select></td>
                        </tr>
                        <tr>
                            <td colspan="4"><span class="tipcontentspan"></span></td>
                        </tr>
                        <tr>
                            <td colspan="4">
                            <div class="btn-float-left">
                                <input type="button" id="readsleeptimebtn" data-inline="true" data-theme="f" value="读取" style="width: 105px;"/>
                                <input type="button" id="setsleeptimebtn" data-inline="true" data-theme="f" value="设置" style="width: 105px;"/>
                                <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="e">取消</a>
                            </div></td>
                        </tr>
                    </table>
                </div>
            </div>

            <!-- 通信目的指示器操作对话框 -->
            <a href="#commtargetindicatorpopup" id="triggercommtargetindicatorpopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="commtargetindicatorpopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>通信目的指示器</h1>
                </div>
                <div data-role="content">
                    <table>
                        <tr>
                            <td width="110px"><label for="aphase">相位<font style="color: red;"> * </font></label></td>
                            <td><label>
                                <input type="radio" name="phase" id="aphase" onclick="selectPhase('1','3')">
                                A相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="bphase" onclick="selectPhase('2','3')">
                                B相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="cphase" onclick="selectPhase('3','3')">
                                C相</label></td>
                        </tr>
                        <tr id="commtargetindicatorinfo" style="display: none;">
                            <td>指示器地址</td><td id="ctindicatoraddr" style="color: gray;"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td colspan="4"><span class="tipcontentspan"></span></td>
                        </tr>
                        <tr>
                            <td colspan="4">
                            <div class="btn-float-left">
                                <input type="button" id="settargetindicatorbtn" data-inline="true" data-theme="f" value="确定"/>
                                <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="e">取消</a>
                            </div></td>
                        </tr>
                    </table>
                </div>
            </div>

            <!-- 读取指示器版本信息操作对话框 -->
            <a href="#indicatorverpopup" id="triggerindicatorverpopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="indicatorverpopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>版本信息</h1>
                </div>
                <div data-role="content">
                    <table>
                        <tr>
                            <td width="110px"><label for="aphase">相位<font style="color: red;"> * </font></label></td>
                            <td><label>
                                <input type="radio" name="phase" id="aphase" onclick="selectPhase('1', '4')">
                                A相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="bphase" onclick="selectPhase('2', '4')">
                                B相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="cphase" onclick="selectPhase('3', '4')">
                                C相</label></td>
                        </tr>
                        <tr id="info0" style="display: none;">
                            <td>指示器地址</td><td id="indicatoraddr" style="color: gray;" colspan="3"></td>
                        </tr>
                        <tr id="info" style="display: none;">
                            <td id="label">版本信息</td>
                            <td id="data" style="color:red;" colspan="3"></td>
                        </tr>
                        <tr >
                            <td colspan="4"><span class="tipcontentspan"></span></td>
                        </tr>
                        <tr>
                            <td colspan="4">
                            <div class="btn-float-left">
                                <input type="button" id="readbtn" data-inline="true" data-theme="f" value="读取" style="width: 105px;"/>
                                <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="e">取消</a>
                            </div></td>
                        </tr>
                    </table>
                </div>
            </div>

            <!-- 指示器翻牌复归操作对话框 -->
            <a href="#indicatorflippopup" id="triggerindicatorflippopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="indicatorflippopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>翻牌复归</h1>
                </div>
                <div data-role="content">
                    <table>
                        <tr>
                            <td width="110px"><label for="aphase">相位<font style="color: red;"> * </font></label></td>
                            <td><label>
                                <input type="radio" name="phase" id="aphase" onclick="selectPhase('1', '5')">
                                A相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="bphase" onclick="selectPhase('2', '5')">
                                B相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="cphase" onclick="selectPhase('3', '5')">
                                C相</label></td>
                        </tr>
                        <tr id="info" style="display: none;">
                            <td>指示器地址</td><td id="indicatoraddr" style="color: gray;" colspan="3"></td>
                        </tr>
                        <tr >
                            <td colspan="4"><span class="tipcontentspan"></span></td>
                        </tr>
                        <tr>
                            <td colspan="4">
                            <div class="btn-float-left">
                                <input type="button" id="flipbtn" data-inline="true" data-theme="f" value="翻牌" style="width: 105px;"/>
                                <input type="button" id="resetbtn" data-inline="true" data-theme="f" value="复归" style="width: 105px;"/>
                                <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="e">取消</a>
                            </div></td>
                        </tr>
                    </table>
                </div>
            </div>

            <!-- 读取实时电场信息操作对话框 -->
            <a href="#indicatorelecfieldpopup" id="triggerindicatorelecfieldpopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="indicatorelecfieldpopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>实时电场</h1>
                </div>
                <div data-role="content">
                    <table>
                        <tr>
                            <td width="110px"><label for="aphase">相位<font style="color: red;"> * </font></label></td>
                            <td><label>
                                <input type="radio" name="phase" id="aphase" onclick="selectPhase('1', '6')">
                                A相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="bphase" onclick="selectPhase('2', '6')">
                                B相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="cphase" onclick="selectPhase('3', '6')">
                                C相</label></td>
                        </tr>
                        <tr id="info0" style="display: none;">
                            <td>指示器地址</td><td id="indicatoraddr" style="color: gray;" colspan="3"></td>
                        </tr>
                        <tr id="info" style="display: none;">
                            <td id="label1">瞬时电场</td>
                            <td id="data1" style="color:red;"></td>
                            <td id="label2">平均电场</td>
                            <td id="data2" style="color:red;"></td>
                        </tr>
                        <tr >
                            <td colspan="4"><span class="tipcontentspan"></span></td>
                        </tr>
                        <tr>
                            <td colspan="4">
                            <div class="btn-float-left">
                                <input type="button" id="readbtn" data-inline="true" data-theme="f" value="读取" style="width: 105px;"/>
                                <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="e">取消</a>
                            </div></td>
                        </tr>
                    </table>
                </div>
            </div>

            <!-- 指示器模块地址修改操作对话框 -->
            <a href="#indicatorcommaddrresetpopup" id="triggerindicatorcommaddrresetpopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="indicatorcommaddrresetpopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>重设模块地址</h1>
                </div>
                <div data-role="content">
                    <table>
                        <tr>
                            <td width="110px"><label for="aphase">相位<font style="color: red;"> * </font></label></td>
                            <td><label>
                                <input type="radio" name="phase" id="aphase" onclick="selectPhase('1', '7')">
                                A相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="bphase" onclick="selectPhase('2', '7')">
                                B相</label></td>
                            <td><label>
                                <input type="radio" name="phase" id="cphase" onclick="selectPhase('3', '7')">
                                C相</label></td>
                        </tr>
                        <tr id="info" style="display: none;">
                            <td>指示器地址</td><td id="indicatoraddr" style="color: gray;"></td>
                            <td id="label">模块新地址<font style="color: red;"> * </font></td>
                            <td id="data1">
                            <input type="text" name="newcommaddr" id="newcommaddr" style="color:red; width: 75px;"/>
                            </td>
                        </tr>
                        <tr >
                            <td colspan="4"><span class="tipcontentspan"></span></td>
                        </tr>
                        <tr>
                            <td colspan="4">
                            <div class="btn-float-left">
                                <input type="button" id="resetbtn" data-inline="true" data-theme="f" value="设置" style="width: 105px;"/>
                                <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="e">取消</a>
                            </div></td>
                        </tr>
                    </table>
                </div>
            </div>

            <!-- 查设终端地址操作对话框 -->
            <a href="#terminaladdrqspopup" id="triggerterminaladdrqspopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="terminaladdrqspopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>终端地址</h1>
                </div>
                <div data-role="content">
                    <table>
                        <tr id="info">
                            <td>终端地址</td>
                            <td>
                            <input type="text" name="newterminaladdr" id="newterminaladdr" style="color:red; width: 120px;"/>
                            </td>
                        </tr>
                        <tr >
                            <td colspan="4"><span class="tipcontentspan"></span></td>
                        </tr>
                        <tr>
                            <td colspan="4">
                            <div class="btn-float-left">
                                <input type="button" id="readbtn" data-inline="true" data-theme="f" value="读取" style="width: 105px;"/>
                                <input type="button" id="resetbtn" data-inline="true" data-theme="f" value="设置" style="width: 105px;"/>
                                <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="e">取消</a>
                            </div></td>
                        </tr>
                    </table>
                </div>
            </div>

            <!-- 查设终端通信參數操作对话框 -->
            <a href="#terminalcommparamsqspopup" id="triggerterminalcommparamsqspopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="terminalcommparamsqspopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>通信参数</h1>
                </div>
                <div data-role="content">
                    <table>
                        <tr id="info">
                            <td>主站IP</td>
                            <td>
                            <input type="text" name="hostip" id="hostip" style="color:red; width: 120px;"/>
                            </td>
                            <td>主站端口</td>
                            <td>
                            <input type="text" name="hostport" id="hostport" style="color:red; width: 120px;"/>
                            </td>
                        </tr>
                        <tr id="info">
                            <td>APN</td>
                            <td>
                            <input type="text" name="apn" id="apn" style="color:red; width: 120px;"/>
                            </td>
                            <td>心跳周期</td>
                            <td>
                            <input type="text" name="heartbeat" id="heartbeat" style="color:red; width: 120px;"/>
                            </td>
                        </tr>
                        <tr id="info">
                            <td>UDP/TCP</td>
                            <td>
                            <select name="connection" id="connection">
                                <option value="0">UDP</option>
                                <option value="1" selected="selected">TCP</option>
                            </select></td>
                        </tr>
                        <tr >
                            <td colspan="4"><span class="tipcontentspan"></span></td>
                        </tr>
                        <tr>
                            <td colspan="4">
                            <div class="btn-float-left">
                                <input type="button" id="readbtn" data-inline="true" data-theme="f" value="读取" style="width: 105px;"/>
                                <input type="button" id="resetbtn" data-inline="true" data-theme="f" value="设置" style="width: 105px;"/>
                                <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="e">取消</a>
                            </div></td>
                        </tr>
                    </table>
                </div>
            </div>

            <!-- 删除确认对话框 -->
            <a href="#removeconfirmpopup" id="triggerremoveconfirmpopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="removeconfirmpopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>删除确认</h1>
                </div>
                <div data-role="content">
                    <input type="hidden" id="type" name="type"/>
                    <input type="hidden" id="_id" name="_id"/>
                    <h4>是否删除<span id="removetypespan"></span> ?</h4>
                    <p>
                        注意, 删除操作不可回退。
                    </p>
                    <div class="btn-float-left">
                        <a href="#" data-role="button" id="removeyesbtn" data-inline="true" data-theme="e">是</a>
                        <a href="#" data-role="button" data-inline="true" data-theme="f" data-rel="back">否</a>
                    </div>
                </div>
            </div>

            <!-- 方案编辑对话框 -->
            <a href="#schemepopup" id="triggerschemepopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="schemepopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>方案<span id="schemeoperspan"></span></h1>
                </div>
                <div data-role="content">
                    <input type="hidden" id="_id" name="_id"/>
                    <table>
                        <tr>
                            <td><label for="schemename">方案名称<font style="color: red;"> * </font></label></td><td>
                            <input type="text" name="schemename" id="schemename" placeholder="方案名称" onfocus="window.configjsi.disableBlueTooth();"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2"><span class="tipcontentspan"></span></td>
                        </tr>
                        <tr>
                            <td colspan="2">
                            <div class="btn-float-left">
                                <a href="#" data-role="button" id="schemeeditbtn" data-inline="true" data-theme="f"></a>
                                <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="e">取消</a>
                            </div></td>
                        </tr>
                    </table>
                </div>
            </div>

            <!-- 线路编辑对话框 -->
            <a href="#worklinepopup" id="triggerworklinepopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="worklinepopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>线路<span id="worklineoperspan"></span></h1>
                </div>
                <div data-role="content">
                    <input type="hidden" id="_id" name="_id"/>
                    <input type="hidden" id="schemeid" name="schemeid"/>
                    <table>
                        <tr>
                            <td><label for="linename">线路名称<font style="color: red;"> * </font></label></td><td>
                            <input type="text" name="linename" id="linename" placeholder="线路名称" onfocus="window.configjsi.disableBlueTooth();"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2"><span class="tipcontentspan"></span></td>
                        </tr>
                        <tr>
                            <td colspan="2">
                            <div class="btn-float-left">
                                <a href="#" data-role="button" id="worklineeditbtn" data-inline="true" data-theme="f"></a>
                                <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="e">取消</a>
                            </div></td>
                        </tr>
                    </table>

                </div>
            </div>

            <!-- 终端编辑对话框 -->
            <a href="#terminalpopup" id="triggerterminalpopup" data-rel="popup" data-position-to="window" data-role="button" style="display: none;"></a>
            <div data-role="popup" id="terminalpopup" data-dismissible="false" data-overlay-theme="f">
                <div data-role="header" data-theme="f">
                    <h1>终端<span id="terminaloperspan"></span></h1>
                </div>
                <div data-role="content">
                    <input type="hidden" id="_id" name="_id"/>
                    <input type="hidden" id="lineid" name="lineid"/>
                    <table>
                        <tr>
                            <td><label for="terminaladdr">终端地址<font style="color: red;"> * </font></label></td><td>
                            <input type="text" name="terminaladdr" id="terminaladdr" placeholder="终端地址" onfocus="window.configjsi.disableBlueTooth();"/>
                            </td>
                            <td rowspan="4" width="20%" valign="top">
                            <div style="margin-left: 10px;">
                                <a href="#" data-role="button" id="terminalvirtualbtn" data-inline="true" data-theme="f">虚拟终端</a>
                                <a href="#" data-role="button" id="terminaleditbtn" data-inline="true" data-theme="f"></a>
                                <a href="#" data-role="button" id="terminalclearbtn" data-inline="true" data-theme="f">清空</a>
                                <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="e">取消</a>
                            </div></td>
                        </tr>
                        <tr>
                            <td><label for="wirelessaddr">无线模块地址<font style="color: red;"> * </font></label></td><td>
                            <input type="text" name="wirelessaddr" id="wirelessaddr" placeholder="无线模块地址" onfocus="window.configjsi.enableBlueTooth();this.focused=true;this.select();" onmouseup="if(this.focused){this.focused=false;return false;}"/>
                            </td>
                        </tr>
                        <tr>
                            <td><label for="location">安装位置</label></td>
                            <td>
                            <input type="text" id="location" placeholder="安装位置" onfocus="window.configjsi.disableBlueTooth();"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2"><span class="tipcontentspan"></span></td>
                        </tr>
                    </table>

                </div>
            </div>

            <div data-role="header" id="implementheader" data-theme="f">
                <h1> 工程实施 </h1>
                <!--左边panel-->
                <a href="#showscheme" data-rel="panel" data-role="button" data-icon="grid" data-iconpos="notext"></a>
                <div id="showscheme" data-role="panel" data-display="overlay" data-position="left" style="min-height: 50%;">
                    <div data-role="header" data-theme="f">
                        <h3>实施方案</h3>
                        <a href="#" data-role="button" id="schemeaddbtn" data-icon="plus" data-iconpos="notext" data-theme="f"></a>
                    </div>
                    <div data-role="content" id="schemecontent">
                        <div id="schemetree" data-role="collapsible-set"></div>
                    </div>
                </div>
                <!--右边panel-->
                <a href="#showimplinfo" data-rel="panel" data-role="button" data-icon="info" data-iconpos="notext"></a>
                <div id="showimplinfo" data-role="panel" data-display="overlay" data-position="right" style="min-height: 50%; z-index: 10; background-color: #ffffff;">
                    <div data-role="header" data-theme="f">
                        <h3>工程信息</h3>
                    </div>
                    <div data-role="content" id="implinfocontent" style="padding: 10px 0;">
                        <div id="implinfobar" data-role="navbar" data-iconpos="right">
                            <ul>
                                <li>
                                    <a id="impllogtab" href="#" class="ui-btn-active ui-state-persist">日志</a>
                                </li>
                                <li>
                                    <a id="implstatustab" href="#" data-icon="refresh">状态</a>
                                </li>
                            </ul>
                        </div>
                        <div id="impllogtabcontent" class="tab-content">
                            <!--
                            <div style="margin-left: 10px;">
                            <input type="button" value="清除" id="clearlogbtn" data-inline="true" data-icon="delete" data-theme="e"/>
                            </div>
                            -->
                            <div id="wrapper" style="top: 90px; left: 4px; right: 4px;">
                                <div>
                                    <div class="log-div"></div>
                                    <!-- 下拉区域 -->
                                    <div id="pullup">
                                        <span class="pullup-icon"></span><span class="pullup-label">上拉加载更多...</span>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div id="implstatustabcontent" class="tab-content" style="display: none;"></div>
                    </div>
                </div>
            </div>

            <!--页面content内容编辑 -->
            <input type="hidden" id="tlineid" name="tlineid"/>
            <input type="hidden" id="currterminal" name="currterminal"/>
            <input type="hidden" id="terminalid" name="terminalid"/>
            <input type="hidden" id="twirelessaddr" name="twirelessaddr"/>
            <input type="hidden" id="tlocation" name="tlocation"/>
            <div data-role="content" id="implementcontent" data-theme="f"
            style="padding: 0px; border-bottom: 0px;"></div>

            <div data-role="footer" data-position="fixed" data-theme="f" style="z-index: 2000">
                <!-- 工作栏编辑 -->
                <div data-role="navbar" id="modebar" data-iconpos="top"
                data-theme="f">
                    <ul>
                        <li>
                            <input type="button" value="安装" id="mode_0" data-icon="plus" data-iconpos="top" data-corners="false">
                        </li>
                        <li>
                            <input type="button" value="调试" id="mode_1" data-icon="gear" data-iconpos="top" data-corners="false">
                        </li>
                        <li>
                            <input type="button" value="查询" id="mode_2" data-icon="search" data-iconpos="top" data-corners="false">
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </body>
</html>
